<?php

class IndexController extends Controller
{
	public function actionIndex()
	{
        Test::show('sdfsd');
		$this->render('index',array(
            'language'=>Yii::app()->language,
            'hello'=>Yii::t('base', 'hello'),
        ));
	}

	public function actionError()
	{
		if($error=Yii::app()->errorHandler->error)
		{
            /*
            if(Setting::getConfig('config_error_log')){
                $errorFile=Yii::app()->params['adminPath'].'system/logs/'.Setting::getConfig('config_error_filename');
                $message=$error->type.': '.$error->message.' in file '.$error->file.' et line '.$error->line;
                if(is_file($errorFile)){
                    $handle=fopen($errorFile,'a+');
                    fwrite($handle,date('Y-m-d G:i:s').' - '.$message."\n");
                    fclose($handle);
                    unset($errorFile);
                }
            }
            */

			if(Yii::app()->request->isAjaxRequest)
				echo $error['message'];
			else
				$this->render('error', $error);
		}
	}
}